翻訳と辞書
Words near each other
・ Object-oriented analysis and design
・ Object-oriented business engineering
・ Object-oriented design
・ Object-Oriented Fortran
・ Object-oriented modeling
・ Object-oriented ontology
・ Object-oriented operating system
・ Object-oriented programming
・ Object-Oriented Software Construction
・ Object-oriented software engineering
・ Object-Oriented Turing
・ Object-oriented user interface
・ Object-PL/SQL
・ Object-relational database
・ Object-relational impedance mismatch
Object-relational mapping
・ Object-role modeling
・ Object-Z
・ ObjectARX
・ ObjectBroker
・ ObjectCenter
・ ObjectDatabase++
・ ObjectDB
・ ObjectDock
・ Objecteering
・ ObjectiF
・ Objectif et action Mutualistes
・ Objectif Exhibitions
・ Objectification
・ Objectified


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Object-relational mapping : ウィキペディア英語版
Object-relational mapping

:''Not to be confused with Object-Role Modeling.
Object-relational mapping (ORM, O/RM, and O/R mapping) in computer science is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own ORM tools.
In object-oriented programming, data management tasks act on object-oriented (OO) objects that are almost always non-scalar values. For example, consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses. This could be modeled in an object-oriented implementation by a "Person object" with attributes/fields to hold each data item that the entry comprises: the person's name, a list of phone numbers, and a list of addresses. The list of phone numbers would itself contain "PhoneNumber objects" and so on. The address book entry is treated as a single object by the programming language (it can be referenced by a single variable containing a pointer to the object, for instance). Various methods can be associated with the object, such as a method to return the preferred phone number, the home address, and so on.
However, many popular database products such as SQL database management systems (DBMS) can only store and manipulate scalar values such as integers and strings organized within tables. The programmer must either convert the object values into groups of simpler values for storage in the database (and convert them back upon retrieval), or only use simple scalar values within the program. Object-relational mapping is used to implement the first approach.
The heart of the problem is translating the logical representation of the objects into an atomized form that is capable of being stored in the database, while preserving the properties of the objects and their relationships so that they can be reloaded as objects when needed. If this storage and retrieval functionality is implemented, the objects are said to be persistent.〔
==Overview==
Implementation-specific details of storage drivers are generally wrapped in an API in the programming language in use, exposing methods to interact with the storage medium in a way which is simpler and more in line with the paradigms of surrounding code.
The following is a simple example. The below is C# code to deliver a query, itself written in SQL, to a database engine.

String sql = "SELECT ... FROM persons WHERE id = 10";
DbCommand cmd = new DbCommand(connection, sql);
Result res = cmd.Execute();
String name = res()();

In contrast, the following makes use of an ORM API, allowing the writing of code which naturally makes use of the features of the language.

Person p = repository.GetPerson(10);
String name = p.getFirstName();

The case above makes use of an object representing the storage repository, and methods of that object. Other frameworks might provide code as static methods, as in the below, and yet other methods may not implement an object-oriented system at all. Often the choice of paradigm is made to fit the ORM best into the surrounding language's design principles.

Person p = Person.Get(10);

Usually, the framework will expose some filtering and querying functionality, allowing subsets of the storage base to be accessed and modified. The code below queries for people in the database whose ID value is '10'.

Person p = Person.Get(Person.Properties.Id == 10);


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Object-relational mapping」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.